package com.ludomancy.spaceopera.entities;
import java.awt.Graphics;
import java.awt.Point;

import com.ludomancy.gamelib.ImageAnimation;
import com.ludomancy.spaceopera.BasicEntity;
import com.ludomancy.spaceopera.Game;
import com.ludomancy.spaceopera.Player;


public class Landpad extends BasicEntity
{
	private ImageAnimation anim;

	public Landpad(Point pos)
	{
		super(pos);
		anim = ImageAnimation.create("landpad.png", 9, 9, 2);
		anim.setSequenceBouncingLoop();
		anim.looping = true;
		anim.play();
		
		width = (int) proj.screenToWorldX(anim.strip.frameWidth);
		height = (int) proj.screenToWorldY(anim.strip.frameHeight);
	}
	
	public String getInteractionVerb()
	{
		return "Leave";
	}
		
	public boolean isInteractable()
	{
		return true;
	}
	
	public void paint(Graphics g, int x, int y)
	{
		anim.update();
		anim.paintCurrentFrame(g, x, y);
	}
	
	public boolean update()
	{
		return false;
	}
	
	public void onPlayerInteraction(Player player)
	{
		Game.game.backToSpace();
	}
}
